<!-- doUserReg.php 用于将用户输入的注册信息添加到数据库。 -->
<?php
   require_once('inc_admin.php'); 
  //连接数据库   
  connect();

  if(!empty($_FILES["wfx_jiajulink"]["name"])){
    $wfx_jiajulink = uploadfile('wfx_jiajulink','./uploads/',array('jpg','gif','png'));
  }
  else{
    $wfx_jiajulink='';
  }

  $data = array(
    'wfx_name' => trim($_POST['wfx_name']),  
    'wfx_cid' => $_POST['wfx_cid'],
    'wfx_brand' => $_POST['wfx_brand'],
    'wfx_intro' => $_POST['wfx_intro'],
    'wfx_jiajulink'=>$wfx_jiajulink,
    'wfx_adddate' => $_POST['wfx_adddate']
    );

  //执行SQL语句
  $result = add('jiaju',$data);
  if(!$result){
    echo "添加失败！<br/>";
    echo "<a href='addjiaju.php'>返回</a>";   
  }else{    
  echo "添加成功！";
  echo "或返回<a href='admin/list.php'>家具列表</a>页面！";   
  }    
  
?>